package com.woniuxy.springbootrabbit.simple;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Producter {
    @Resource
    private AmqpTemplate amqpTemplate;  //RabbitTemplate

    public void send(String msg){
        // 发消息
        // 参数1：消息队列的名字
        // 参数2：消息
        amqpTemplate.convertAndSend("simple_queue", msg);
    }
}
